package com.zq.learn.spark.springspark;

import com.zq.learn.spark.SparkApplication;
import com.zq.learn.spark.springspark.SparkService;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit.jupiter.SpringExtension;

/**
 * StreamComputingTest
 * 在Spring控制环境下，使用SparkStreaming进行计算，并将计算结果写入mongodb。
 *
 * @author ZhangQi
 * @date 2020/2/12
 */
@ExtendWith(SpringExtension.class)
@SpringBootTest(classes = {SparkApplication.class}, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class StreamComputingTest {
  @Autowired
  private SparkService sparkService;

  @Test
  public void statisticOrder(){
    sparkService.statisticOrder();
  }
}
